package com.joker.yuwu;

import com.joker.repository.RootCreatZg;
import com.joker.repository.RootCreatZw;
import net.sf.json.JSONObject;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/rootcreatzw")
public class RootCreatZhanwei extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        super.doGet(req, resp);
        req.setCharacterEncoding("utf-8");
        String zgname=req.getParameter("zgname");
        String zwname=req.getParameter("zwname");
        String xinxi=req.getParameter("xinxi");
//        String zhuangtai=req.getParameter("zhuangtai");
        RootCreatZw r1=new RootCreatZw();
//        创建展馆,默认状态是0
        boolean b1=r1.creat(zwname,xinxi,"0",zgname);
        JSONObject obj=new JSONObject();
        obj.put("data",b1);
        resp.getWriter().write(obj.toString());

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}
